<?php
namespace app\admin\model;

use think\Db;
use think\Model;

class AdminUsers extends Model
{
    /**
     * 验证账户
     */
    public function checkLogin($data)
    {
//        $data['password'] = md5($data['password']);
        return Db::name('admin_users')->where($data)->find();
    }

    /**
     * 增加用户
     */
    public function addUser($data)
    {
        return Db::name('admin_users')->insertGetId($data);
    }

    /**
     * 查询所有账户
     */
    public function userList()
    {
        return Db::name('admin_users')->paginate(10);
    }

}